﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cspl.Project.Console;
using Cspl.Project.Interface;
using System.Collections;
using Cspl.Project.Console.DefaultNamespace;

namespace Cspl.Project.Namespace
{
    public delegate int Plus1Delegate(int param);

    class Program
    {
        static void Main(string[] args)
        {
            IList<Point> points = new List<Point>();
            points.Add(new Point { X = 1, Y = 2 });
            points.Add(new Point { X = 1, Y = 3 });
            points.Add(new Point { X = 1, Y = 4 });
            points.Add(new Point { X = 2, Y = 2 });
            points.Add(new Point { X = 2, Y = 3 });

            //var pointsX1 = points.Where(p => p.X == 1);
            //var pointsY4 = points.Where(p => p.Y == 4);
            var pointsX2 = points.Where(p => p.X == 2);

            foreach (var point in pointsX2)
            {
                System.Console.WriteLine("Point X={0}, Y={1}", point.X, point.Y);
            }
        }


        //int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 };

        //IList<int> eventNumbers = new List<int>();

        //for (int i = 0; i < numbers.Length; i++)
        //{
        //    if (numbers[i] % 2 == 0)
        //    {
        //        eventNumbers.Add(numbers[i]);
        //    }
        //}

        //foreach (int num in numbers)
        //{
        //    if (num % 2 == 0) 
        //    {
        //        eventNumbers.Add(num);
        //    }

        //}
        //using lambda expression    
        //    var eventNumbers = numbers.Where(num => num % 2 == 0);

        //    foreach (int num in eventNumbers)
        //    {
        //        System.Console.Write("{0,1} ", num);
        //    }
        //}

        //static bool EventNumberCheck(int num)
        //{ 
        //    return num % 2 == 0;
        //}

        //lambda expression
        //void MethodA(int a, int b)
        //{
        //    (a, b) =>
        //    {

        //    };
        //}
    }



    //IList<string> list = new List<string>() { "A", "B", "C", "D" };
    //int i = 0;

    //int j = --i;
    //int k = i--;

    //int num = 32;

    //string evenOrOdd = num % 2 == 0 ? "Even" : "Odd";

    //if (num % 2 == 0)
    //{
    //    evenOrOdd = "Even";
    //}
    //else
    //{
    //    evenOrOdd = "Odd";
    //}
}

//static int Plus1Method(int param)
//    {
//        return param + 1;
//    }
//}

//    enum Days { Sunday = 1, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday }
//}
